package com.ruoyi.service.impl;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.Basislabel;
import com.ruoyi.mapper.BasisLabelMapper;
import com.ruoyi.service.BasisLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author yichaofan
 * date 2025/5/27
 */
@Service
public class BasisLabelServiceImpl implements BasisLabelService {
    @Autowired
    BasisLabelMapper labelMapper;

    @Override
    public List<Basislabel> selectLabelList(Basislabel basislabel) {
        return labelMapper.selectLabelList(basislabel);
    }

    @Override
    public List<Basislabel> seletLableByEventId(Long eventId) {
        return labelMapper.seletLableByEventId(eventId);
    }

    @Override
    public void isnertLabel(Basislabel basislabel) {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        basislabel.setUseId(user.getUserId());
        basislabel.setCreateTime(new Date());
        labelMapper.isnertLabel(basislabel);
    }

    @Override
    public void deleteLabelByIds(Long[] ids) {
        labelMapper.deleteLabelByIds(ids);
    }

    @Override
    public void updateLabel(Basislabel basislabel) {
        labelMapper.updateLabel(basislabel);
    }
}
